<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Blitz++ build and test guide</title>
<link rel="stylesheet" type="text/css" href="https://gcc.gnu.org/gcc.css" />
</head>

<body>
<h1>Blitz++ build and test guide</h1>

<p>This page is a guide to building the
<a href="https://sourceforge.net/projects/blitz/">Blitz++</a> scientific
computing class library as part of GCC integration testing.</p>

<h2>Resource usage</h2>

<p>The Blitz++ 0.7 distribution, available via the <a
href="https://sourceforge.net/projects/blitz/files/">Blitz++ download
page</a> at SourceForge is a 2.0 MB file.  The uncompressed
distribution comprises 10.5 MB of source files.  Building and running the
testsuite adds an additional 75 or so MB of object files
and executables to this, and building the Blitz++ example programs
adds another 50 MB.</p>

<p>Building and running the Blitz++ testsuite on a 750 Mhz
Pentium III laptop takes 17 minutes.  Building the Blitz++ example
programs takes another 20 minutes.</p>

<p>All of the make commands below have been tested with
<code>make -j 8</code>.</p>

<h2>Prepare</h2>

<p>To prepare the Blitz++ distribution, perform the following:</p>
<ul>
<li>Unpack the file:
    <ul>
    <li><code>tar zxf Blitz++-0.7.tar.gz</code>, or</li>
    <li><code>gunzip -c Blitz++-0.7.tar.gz | tar xf -</code></li>
    </ul>
</li>
<li>Change to the new directory:
    <ul>
    <li><code>cd Blitz++-0.7</code></li>
    </ul>
</li>
</ul>

<p>Running <code>configure</code> and <code>make</code> require that
the directory containing the C++ libraries to test is in
<code>LD_LIBRARY_PATH</code>.</p>

<h2>Configure</h2>

<p>You can use the simplest form of configuration if the directory
containing the compiler under test is in your <code>PATH</code> variable
and you don't want specific compilation options:</p>

<pre><code>./configure --prefix=`pwd` --with-cxx=gcc
</code></pre>

<p>To specify optimizations (by default Blitz++ is built using no
optimization flags) and to specify the full pathname of the compiler,
configure with:</p>

<pre><code>GCC_INST=directory/where/you/installed/GCC
./configure --prefix=`pwd` \
    --with-cxx="gcc:${GCC_INST}/bin/g++ &lt;optimization_flags&gt;" 
</code></pre>

<h2>Testing</h2>

<p>To build the Blitz++ library, do:</p>

<pre><code>make lib</code></pre>

<p>To build and run the Blitz++ tests, do:</p>

<pre><code>make check-testsuite</code></pre>

<p>The output of <code>make check-testsuite</code> should include the line
&quot;All tests passed&quot;.  Failure to build a test prevents the rest of the
tests from being built and any of the tests from running.  To build and
run an individual test (see the list for <code>EXTRA_PROGRAMS</code> from
<code>testsuite/Makefile</code>), do:</p>

<pre><code>cd testsuite
make &lt;testname&gt;
./&lt;testname&gt; || echo failed
</code></pre>

<p>The Blitz++ distribution also includes examples.  To build the examples
as well as building and running the tests, do:</p>

<pre><code>make check-examples</code></pre>

<p>As with the testsuite, the output should include the line &quot;All tests
passed&quot;.</p>

<h2>Interoperability testing</h2>

<p>Use Blitz++ to test interoperability of two compilers by first
configuring to use one compiler, building the library with
<code>make lib</code>, running <code>configure</code> a second time
specifying the second compiler, and then running
<code>make check-testsuite</code> or
<code>make check-examples</code>.</p>

<h2>Timing</h2>

<p>The Blitz++ distribution includes benchmarks, most of which have pieces
in C++, Fortran 77, and Fortran 90.  These compare the performance of C++
code that uses the Blitz++ library with similar functionality in Fortran.
The loop benchmarks don't require Fortran 90 and could be used to compare
timings of two versions of GGC.</p>

<h2>Cleanup</h2>

<p>Cleanup (to prepare the directory for a fresh run, e.g.
with another version of the compiler), is done as follows:</p>

<pre><code>make -k clean</code></pre>

</body>
</html>
